import { getFldm } from '@/utils/get-fldm'
import TreeUtilDTO from '@/utils/tree'
export const formItems = async (key: string) => {
  const obj: any = {
    ssflcx: [
      {
        disabled: false,
        label: '',
        prop: 'gjz',
        type: 'input',
        placeholder: '请输入关键字',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '案件名称',
        prop: 'ajmc',
        type: 'input',
        placeholder: '请输入案件名称',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '请输入档号',
        iswm: 'N',
        options: [],
      },
      {
        disabled: false,
        label: '立卷单位',
        prop: 'ljdw',
        type: 'treeSelectAll',
        multiple: true,
        nodeKey: 'dwbm',
        showAll: true,
        isLeafNode: false,
        showCurrentButton: true,
        checkStrictly: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '请选择立卷单位',
        options: [],
        iswm: 'N',
      },
      {
        disabled: false,
        label: '归档年度',
        prop: 'gdnd',
        type: 'input',
        placeholder: '请输入归档年度',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '保管期限',
        prop: 'bgqx',
        type: 'select',
        placeholder: '请选择保管期限',
        options: await getFldm('gd020'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '密级',
        prop: 'mj',
        type: 'select',
        placeholder: '请选择密级',
        options: await getFldm('gd006'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '部门受案号',
        prop: 'bmsah',
        type: 'input',
        placeholder: '请输入部门受案号',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '检察官',
        prop: 'jcg',
        type: 'input',
        placeholder: '请输入检察官',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '当事人',
        prop: 'dsr',
        type: 'input',
        placeholder: '请输入当事人',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '案由',
        prop: 'ay',
        type: 'treeSelectAll',
        multiple: true,
        showCurrentButton: true,
        isLeafNode: false,
        checkStrictly: false,
        placeholder: '请选择案由',
        iswm: 'N',
        showAll: true,
        options: TreeUtilDTO.getTreeData(await getFldm('9903'), 'dm', 'fdm'),
      },
    ],
    spflcx: [
      {
        disabled: false,
        label: '',
        prop: 'gjz',
        type: 'input',
        placeholder: '请输入关键字',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '请输入档号',
        iswm: 'N',
        options: [],
      },
      {
        disabled: false,
        label: '立卷单位',
        prop: 'ljdw',
        type: 'treeSelectAll',
        multiple: true,
        showAll: true,
        checkStrictly: false,
        showCurrentButton: true,
        nodeKey: 'dwbm',
        isLeafNode: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '请选择立卷单位',
        options: [],
        iswm: 'N',
      },
      {
        disabled: false,
        label: '保管期限',
        prop: 'bgqx',
        type: 'select',
        placeholder: '请选择保管期限',
        options: await getFldm('gd020'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '归档年度',
        prop: 'gdnd',
        type: 'input',
        placeholder: '请输入归档年度',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '密级',
        prop: 'mj',
        type: 'select',
        placeholder: '请选择密级',
        options: await getFldm('gd006'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '录制者',
        prop: 'lzz',
        type: 'input',
        placeholder: '请输入录制者',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '题名',
        prop: 'tm',
        type: 'input',
        placeholder: '请输入题名',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '视频类型',
        prop: 'splx',
        type: 'select',
        placeholder: '请选择视频类型',
        iswm: 'N',
        options: await getFldm('gd021'),
      },
    ],
    jyd: [
      {
        disabled: false,
        label: '借阅单编号',
        prop: 'jydbh',
        type: 'input',
        placeholder: '请输入借阅单编号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '申请日期',
        prop: 'sq-rq',
        type: 'daterange',
        placeholder: '请选择申请日期',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档案所属院',
        prop: 'sjdwbm',
        type: 'treeSelectAll',
        showAll: true,
        multiple: true,
        nodeKey: 'dwbm',
        isLeafNode: false,
        checkStrictly: true,
        showCurrentButton: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '请选择档案所属院',
        options: [],
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档案类型',
        prop: 'jydalxdms',
        type: 'select',
        multiple: true,
        placeholder: '请选择档案类型',
        options: await getFldm('gd042'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅类型',
        prop: 'jylxdm',
        type: 'select',
        placeholder: '请选择借阅类型',
        options: await getFldm('gd048'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅方式',
        prop: 'jyfsdm',
        type: 'select',
        placeholder: '请选择借阅方式',
        options: await getFldm('gd043'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅目的',
        prop: 'jymddm',
        type: 'select',
        placeholder: '请选择借阅目的',
        options: await getFldm('gd044'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅明细',
        prop: 'jymx',
        type: 'input',
        placeholder: '请输入借阅明细',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅状态',
        prop: 'jyztdm',
        type: 'select',
        placeholder: '请选择借阅状态',
        options: await getFldm('gd045'),
        iswm: 'Y',
      },
    ],
  }
  return obj[key]
}
